// theme.ts
import { DefaultTheme } from 'styled-components';

// 1. 定义完整的Token类型
export interface ThemeToken {
  colorPrimary: string;
  colorInfo: string;
  colorBgBase: string;
  borderRadius: number;
  wireframe: boolean;
  colorText: string;
  colorTextSecondary: string;
  colorBorder: string;
  colorBgContainer: string;
  marginLG: number;
}

// 2. 通过声明合并扩展DefaultTheme
declare module 'styled-components' {
  export interface DefaultTheme {
    token: ThemeToken;
    components: {
      Button: {
        controlHeight: number;
        fontSize: number;
      };
      Card: {
        boxShadow: string;
        headerBg: string;
      };
    };
  }
}

// 3. 完整主题配置
export const theme: DefaultTheme = {
  token: {
    colorPrimary: "#002FA7",
    colorInfo: "#1A237E",
    colorBgBase: "#F5F7FA",
    borderRadius: 4,
    wireframe: false,
    colorText: "#1F1F1F",
    colorTextSecondary: "#666",
    colorBorder: "#D9D9D9",
    colorBgContainer: "#FFFFFF",
    marginLG: 24
  },
  components: {
    Button: {
      controlHeight: 36,
      fontSize: 14,
    },
    Card: {
      boxShadow: "0 4px 12px rgba(0,47,167,0.15)",
      headerBg: "transparent",
    },
  },
};